FROM openjdk:8-jre-alpine
COPY ./target/*.jar /devops-demo.jar
# 设置时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone && touch /app.jar

ENV JAVA_OPTS=""
ENV PARAMS=""
ENTRYPOINT [ "sh", "-c", "java -Djava.security.egd=file:/dev/./urandom $JAVA_OPTS -jar /devops-demo.jar $PARAMS" ]
# docker run -e JAVA_OPTS="-Xmx512m -Xms33 -" -e PARAMS="-- spring.profiles=dev --server.port=8080" -jar /app/app.jar
# docker run -d -p 8080:8080 javademo